package com.zoweunion.mechanic.service.base;

import com.github.pagehelper.PageInfo;
import com.zoweunion.mechanic.entity.CarListBean;
import com.zoweunion.mechanic.entity.FacilitatorEntity;
import com.zoweunion.mechanic.model.User;
import com.zoweunion.mechanic.util.MyException;

import java.util.List;
import java.util.Map;

public interface OwnerService {

	/**
	 * 给车主添加车辆
	 * @param reqMap  车主id 车辆数据
	 * @return
	 */
	int addCar(Map<String, Object> reqMap) throws MyException;

	/**
	 * 编辑车辆
	 * @param reqMap
	 * @return
	 */
	int editCar(Map<String, Object> reqMap);

	/**
	 * 解绑车辆
	 * @param reqMap  车辆id
	 * @return
	 */
	int unbind(Map<String, Object> reqMap);

	/**
	 * 车主列表展示 ((分页,条件查询)
	 * @param reqMap
	 * @return 车主信息集合 包含 车主已拥有车数量
	 */
	Map<String, Object> getPageQuery(Map<String, Object> reqMap);

	/**
	 * 服务商树形展示
	 * @return 服务商集合
	 */
	List<FacilitatorEntity> getFacilitatorList(Map<String, Object> reqMap);


	/**
	 * 根据车主id查询车主的车辆列表及司机信息
	 */
	List<Map<String, Object>> getCarsByOid(Map<String, Object> reqMap);

	/**
	 * 对该服务商下所有未绑定物联网卡进行列表分页 和物联网编号条件查询
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getThingsList(Map<String, Object> reqMap);

	/**
	 * 删除车主 同时解绑车主下的物联网卡
	 * @param reqMap
	 * @return
	 * @throws Exception 
	 */
	int deleteOwner(Map<String, Object> reqMap) throws MyException;

	/**
	 * 根据车辆opc_path 获取车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getOneCarLocation(Map<String, Object> reqMap);

	/**
	 * 根据车辆opc_path 获取车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getOneCarLocationNew(Map<String, Object> reqMap) throws MyException;

	/**
	 * 查询服务商下所有车辆位置
	 * @param reqMap
	 * @return
	 */
	List<Map<String, Object>> getAllCarLocation(Map<String, Object> reqMap);

	/**
	 * 查询服务商下所有车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getAllCarLocationNew(User currentUser, Map<String, Object> reqMap);

	/**
	 * 查询服务商下所有车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getCarRealData(User currentUser, Map<String, Object> reqMap) throws MyException;

	/**
	 * 查询服务商下所有车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getRunningRecordNew(User currentUser, Map<String, Object> reqMap) throws MyException;

	/**
	 * 查询服务商下所有车辆位置
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> carHistoricalDataPCNew(User currentUser, Map<String, Object> reqMap) throws MyException;


	List<Map<String, Object>> listIndex(User currentUser, Map<String, Object> reqMap);

	Map<String, Object> carHistoricalDataLineNew(User currentUser, Map<String, Object> reqMap) throws MyException;




	/**
	 * 查询服务商下所有车辆位置 分页
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getAllCar(Map<String, Object> reqMap);
	
	List<Map<String, Object>> getAllCarList(Map<String, Object> reqMap);

	List<Map<String, Object>> getCarsBySid(Map<String, Object> reqMap);

	List<Map<String, Object>> getCars(Map<String, Object> reqMap);

	boolean bindingCar(Map<String, Object> reqMap);

    /**
     * 获取发动机名称表
     * @return
     */
    List<Map<String, Object>> getEngineNameList();

    PageInfo getOwnerList(Map<String, Object> reqMap);

    PageInfo getCarsByOidNew(Map<String, Object> reqMap);

    String getFirstBySid(Map<String, Object> reqMap);

	void updateCarInfoById(Map<String, Object> reqMap);

    List<CarListBean> carsListExport(Map<String, Object> reqmap);

    String getServerName(Map<String, Object> reqMap);

    //通过车主id逻辑删除owner表中车主与车辆的关联
    void deleteCarByOwner(String id);

	int applyAccountingPeriod(Map<String, Object> reqMap);

	int addApplyAccountingPeriodRecord(Map<String, Object> reqMap);

	int selectApplyAccountingPeriod(Map<String, Object> reqMap);

	Map<String, Object> selectAccountingPeriodInfo(Map<String, Object> reqMap);

	int updateAccountingPeriod(Map<String, Object> reqMap);

	List<Map<String, Object>> selectApplyAccountingPeriodRecord(Map<String, Object> reqMap);

	void insertRepaymentStatement(Map<String, Object> reqMap);

	void deleteRepaymentStatement(Map<String, Object> reqMap);

	List<Map<String, Object>> selectRepaymentStatement(Map<String, Object> reqMap);

	void updateRepaymentStatement(Map<String, Object> reqMap);

	List<Map<String, Object>> selectAllNoRepaymentStatement();

	List<Map<String, Object>> selectAllNoRepaymentStatementByDay(int day);
}
